Skip to content

fix: netlify settings to cache and multithread in prod better#157

Merged
irubido merged 1 commit into
mainfrom
fix/update-fix-NU6
Feb 9, 2026
Merged

fix: netlify settings to cache and multithread in prod better#157
irubido merged 1 commit into
mainfrom
fix/update-fix-NU6

Conversation

@sqhell

@sqhell sqhell commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Add netlify.toml with Cache-Control headers for static assets (WASM/JS/CSS) to reduce bandwidth - WASM files are 60MB and were being re-downloaded on every page load
  • Add COOP/COEP headers in netlify.toml for SharedArrayBuffer support (required for WASM multi-threading)
  • Add SPA redirect rules for client-side routing
  • Update generate-manifest.js to include http://app-provider.localhost:3000 in dev allowed origins (Parcel uses this subdomain)

Tests

Verify caching headers work (after Netlify deploy):

curl -sI https://webzjs.chainsafe.dev/webzjs_wallet_bg.*.wasm | grep Cache-Control

Expected: Cache-Control: public, max-age=31536000, immutable

Verify COOP/COEP headers:

curl -sI https://webzjs.chainsafe.dev | grep -i cross-origin

Expected: Cross-Origin-Opener-Policy: same-origin

Cross-Origin-Embedder-Policy: require-corp

Local dev test:

cd ~/ztest/WebZjs && yarn dev

Open http://localhost:3000, verify snap connects without origin errors

Issues

  • Fixes high Netlify bandwidth usage (174GB in Jan vs 27GB in Dec) caused by missing cache headers on 60MB WASM files
  • Fixes local dev snap origin rejection for app-provider.localhost:3000

@sqhell sqhell requested a review from irubido February 9, 2026 15:51
@irubido irubido merged commit f01ad7a into main Feb 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants